package com.example.mytestdemo

import android.app.Application
import android.content.res.Resources
import android.util.Log
import com.example.mytestdemo.utils.ShowPageUtil

/**
 *@Author tgw
 *@Date 2023/04/19
 *@describe
 */
class MyApplication:Application() {

    companion object{
        private const val TAG = "MyApplication"
    }
    
    override fun onCreate() {
        setTheme(R.style.ActivitySplash2)
        super.onCreate()
//        MyInstrumentation.attach(this)
        Log.d(TAG, "onCreate: ")
//        Thread.sleep(5000)
        ShowPageUtil.init(this)
    }

    override fun setTheme(resId: Int) {
        val resId2 = R.style.ActivitySplash2
        val resId = R.style.ActivitySplash1
        super.setTheme(resId2)
        Log.d(TAG, "setTheme: $resId ")
        Log.d(TAG, "setTheme: $resId2 ")
    }

    override fun getTheme(): Resources.Theme {
        Log.d(TAG, "getTheme: ")
        // 创建一个新的主题对象
        val theme = super.getTheme()
        theme.applyStyle(R.style.ActivitySplash2, true)
        return theme
    }

}
